package com.gdk.ksoft.assembly.dialog;

import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.view.View;
import android.view.Window;
import android.widget.TextView;

import com.gdk.ksoft.R;
import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ViewInject;

/**
 * Created by Mrper on 2014/11/22.
 * 退出提示框
 */
public class ExitDialog extends Dialog {

    @ViewInject(R.id.dexit_txtCancel)private TextView txtCancel;//取消
    @ViewInject(R.id.dexit_txtOK)private TextView txtOk;//确定

    public ExitDialog(Context context) {
        super(context);
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
        View rootView = View.inflate(context, R.layout.dialog_exit, null);
        setContentView(rootView);
        ViewUtils.inject(this, rootView);
    }

    public void OnPositiveNegitiveClick(View.OnClickListener listener){
        if(listener!=null){
            txtCancel.setOnClickListener(listener);
            txtOk.setOnClickListener(listener);
        }
    }

}
